﻿@model IEnumerable<AfrikDotnetWebSite.Models.Job>

@{
    ViewBag.Title = "Jobs";
}

<div class="jobs cf">
    <div class="large-pane float-left">
        <h2>Jobs</h2>
        <div>
            @if (Model.Count() > 0)
            {
            <table class="list">
                <tr>
                    <th>
                        Position
                    </th>
                    <th>
                        Location
                    </th>
                    <th>
                        posted on
                    </th>
                    <th>
                        expires
                    </th>
                </tr>
            @{ var i = 0; }
            @foreach (var item in Model)
            {
                i++;
                var oddEven = i % 2 == 0 ? "even" : "odd";
                <tr class="@oddEven">
                    <td>
                        <a href="@Url.Action("details", new { id = item.Id })">@Html.DisplayFor(modelItem => item.Title)</a>
                        <div class="company">
                           @Html.DisplayFor(modelItem => item.Company)
                        </div>
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Location)
                    </td>
                    <td>
                        @item.PostedOn.ToString("dd MMM yyyy ")
                    </td>
                    <td>
                        @item.ExpiresOn.ToString("dd MMM yyyy ")
                    </td>
                </tr>
            }
            </table>
            }
            else { 
                <div class="list">There are no open jobs at this time.</div>
            }
        </div>
    </div>
    <div class="small-pane float-right">
        @Html.Partial("_SidePane")
     </div>
</div>


